#复数类型
# com_one = 3 + 2j
# print(com_one)
# com_two = complex(3,2)
# print(com_two)

#布尔类型
# bol_one = bool(None)
# print(bol_one)
# bol_two = bool(0)
# print(bol_two)
# bol_thr = bool([])
# print(bol_thr)
# bol_fou = bool(2)
# print(bol_fou)

#算数运算符
# result_one = 3 + 3 +2j
# print(result_one)
# result_two = 3 * 4.5
# print(result_two)
# result_thr = 5.5 - 2 + 3j
# print(result_thr)
# result_fou = True + 1 + 2j
# print(result_fou)

#or
# result_one = 0 or 3 + 5
# print(result_one)
# result_two = 3 or 0
# print(result_two)

#not
# result_one = not 3 - 5
# print(result_one)
# result_two = not False
# print(result_two)

#成员运算
# words = 'abcdefg'
# print('f' in words)
# print('c' not in words)




#位运算符
# num_one = 10
# num_two = 11
# result_one = num_one << 2
# print(result_one)
# result_two = num_one >> 2
# print(result_two)
# result_thr = num_one & 2
# print(result_thr)
# result_fou = num_one | 2
# print(result_fou)
# result_fiv = num_one ^ num_two
# print(result_fiv)
# result_six = ~num_one
# print(result_six)










#符号%
# name = "小明"
# age = 12
# result = "你好，我叫%s，今年我%d岁了。" % (name,age)
# print(result)

#format()方法
# name = "小明"
# age = 21
# result_one = "你好，我的名字是{},今年我{}岁了。".format(name,age)
# print(result_one)
# result_two = "你好，我的名字是{1}，今年我{0}岁了".format(age,name)
# print(result_two)

#f-strings
# address = '北京'
# result =f'欢迎来到{address}。'
# print(result)

# name = '小天'
# age = 20
# gender = '男'
# result = f'我的名字是{name}，今年{age}岁了，我的性别是{gender}。'
# print(result)

#字符串拼接
# word = "日月之行，若出其中；星汉灿烂，若出其里；"
# result_one = word.replace("；","。")
# print(result_one)
# result_two = word.replace("；","。",1)
# print(result_two)

# 字符串分割
# word = "1 2 3 4 5"
# result_one = word.split()
# print(result_one)
# word = "a,b,c,d,e"
# result_two = word.split(",")
# print(result_two)
# result_thr = word.split(",",3)
# print(result_thr)

# 去除字符串两侧空格
# word = "**勤而行之**"
# result  = word.strip("*")
# print(result)

# 切片
# str_python = "python"
# result_one = str_python[0:4]
# print(result_one)
# result_two = str_python[0:4:2]
# print(result_two)

# 类型转换函数
result_one = int(3.6)
print(result_one)
result_two = int(False)
print(result_two)
result_thr = float(3)
print(result_thr)
result_fou = float("3.1415926")
print(result_fou)